--[[
* 
 * 主人死亡时, 召唤物强行死亡掉
*]]
---@class BuffEffect80 : BaseBuffEffect
BuffEffect80 = ClientFight.CreateClass("BuffEffect80", ClientFight.BaseBuffEffect)
local t = BuffEffect80
---@param fight Fight
---@param buff FighterBuff

function t:add(fight, buff)
    if (not buff.target:isSummons()) then
        return IBuffEffect.FAIL;
    end
    return ClientFight.BaseBuffEffect.add(self, fight, buff);
end
function t:action(fight, buff, ...)
    local parameters = {...};
    if not (parameters[1].__cname == "Fighter") then
        return IBuffEffect.FAIL;
    end
    local die = parameters[1];
    if (die ~= buff.target.summonsCreater) then
        return IBuffEffect.FAIL;
    end
    FighterManager.die(fight, buff.target, null, FighterDieType.SUMMON_EXPIRE);
    return ClientFight.BaseBuffEffect.action(self, fight, buff, parameters);
end

t.New()